import cPickle as pickle

def persist(obj, path):
    f = open(path, mode='wb')
    dump(obj, f, pickle.HIGHEST_PROTOCOL)
    f.close()
        
def depersist(path):
    f = open(path, mode='rb')
    obj = load(f)  
    f.close()
    return obj